//
//  HBChapterHeadView.m
//  HeartBeat
//
//  Created by karong on 2023/8/31.
//

#import "HBChapterHeadView.h"
@interface HBChapterHeadView ()
@property (weak, nonatomic) IBOutlet UILabel *totalLabel;
@property (weak, nonatomic) IBOutlet UIButton *sortBtn;

@end
@implementation HBChapterHeadView
- (void)setDataWithTotal:(NSInteger)total sort_type:(NSInteger)sort_type {
    self.totalLabel.text = SF(WSLocalized(@"共%ld章"), (long)total);
    self.sortBtn.selected = sort_type == 2;
}

- (IBAction)sortAction:(UIButton *)sender {
    sender.selected = !sender.selected;
    if ([self.delegate respondsToSelector:@selector(chapterSortAction:)]) {
        [self.delegate chapterSortAction:sender.selected];
    }
}

@end
